home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iirtels.asp < prev    next >
Encoding:
Text File  |  1999-07-09  |  10.3 KB  |  392 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <!--#include file="iirtels.str"-->
  6. <!--#include file="iisetfnt.inc"-->
  7. <!--#include file="iiset.inc"-->
  8. <%
  9.     ' Do not use top.title.Global.update flag if page is loaded into a dialog
  10.     bUpdateGlobal = false
  11. %>
  12. <!--#include file="calendar.str"-->
  13. <!--#include file="date.str"-->
  14.  
  15. <% 
  16. Dim level
  17.  
  18. level = Request.QueryString("level")
  19. if (level = "") then
  20.     level = 0
  21. end if 
  22.  
  23.  
  24.     
  25. function writeSlider(prop, stops, width, selnum)
  26.     dim slidestr, i
  27.     slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  28.     for i=0 to stops-2
  29.         slidestr=slidestr & drawStop(i,prop, selnum) 
  30.         slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
  31.     Next
  32.     slidestr=slidestr & drawStop(i, prop, selnum)
  33.     slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  34.     writeSlider=slidestr
  35. end function 
  36.  
  37. function drawStop(curr,prop, selnum)
  38.     dim thisname, slidestr,formname
  39.     thisname=quote & prop & curr & quote 
  40.     if Session("IsIE") then 
  41.         formname = "parent.document.userform."
  42.     else
  43.         formname = "document.userform."
  44.     end if 
  45.     slidestr="<A HREF='javascript:moveSlider(" &  formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
  46.     if cInt(curr)=cInt(selnum) then
  47.         drawStop=slidestr & "<IMG NAME=" & thisname &  " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  48.     else
  49.         drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  50.     end if
  51. end function 
  52.  
  53. %>
  54.     
  55. <!--#include file="date.inc"-->
  56.  
  57. <HTML>
  58. <HEAD>
  59.     <TITLE></TITLE>
  60.  
  61. <SCRIPT LANGUAGE="JavaScript">
  62.         
  63. <% if not Session("IsIE") then %>
  64.     slideron=new Image(11,26);
  65.     slideron.src="images/slideron.gif";    
  66.     slideroff=new Image(11,26);
  67.     slideroff.src="images/slideroff.gif";
  68.     lastslide="hdnPics<%= level %>";
  69. <% end if %>        
  70.  
  71.         theList = parent.head.cachedList;
  72.         uform = document.userform;
  73.         headform = parent.head.document.hiddenform;
  74.         
  75.         var dateFormatter = new UIDateFormat( <%= DATEFORMAT_LONG %> );
  76.         
  77.         function moveSlider(control,prop,num){
  78.             top.title.Global.updated=true;            
  79.             <% if Session("IsIE") then %>
  80.                 slideurl="iislider.asp?selnum="+num+"&stops=5&width=80&prop="+prop;
  81.                 control.value=num;
  82.                 document.Slider.location.href=slideurl;                            
  83.             <% else %>
  84.                 turnSlideOff(lastslide);
  85.                 lastslide=prop+num;
  86.                 thisprop=prop+num;
  87.                 document [thisprop].src=slideron.src;
  88.                 control.value=num;
  89.             <% end if %>
  90.             setLevel(num);
  91.         }
  92.     
  93.         function turnSlideOff(prop){
  94.                     document [prop].src=slideroff.src;
  95.         }
  96.             
  97.         function setLevel(num){
  98.             setRatingString(num);
  99.             theList[headform.index.value].sel = num;
  100.             setUpdated();
  101.             showLevel();
  102.         }
  103.         
  104.         function showLevel(){
  105.             uform = document.userform;        
  106.             uform.level.value = theList[headform.index.value].level[uform.hdnPics.value];
  107.         }
  108.         
  109.         function setRatingString(num){
  110.             ratings = "r (";
  111.             for (i=0;i<theList.length;i++){
  112.                 ratings += theList[i].key + " " + theList[i].sel;    
  113.             }
  114.             ratings += ")";                
  115.         }
  116.         function padGMToffset(iOffset)
  117.         {
  118.             var strOffset =Math.abs(iOffset).toString();
  119.             var iOffsetLen = strOffset.length;
  120.             switch(iOffsetLen)
  121.             {
  122.                 case 1:
  123.                     strOffset = "000" + strOffset;
  124.                     break;
  125.                 case 2:
  126.                     strOffset = "00" + strOffset;
  127.                     break;
  128.                 case 3:
  129.                     strOffset = "0" + strOffset;
  130.                     break;
  131.                 default:
  132.                     strOffset = "0000";
  133.             }
  134.             return strOffset;
  135.             
  136.         }
  137.         function setUpdated()
  138.         {
  139.             //parent.head.listFunc.seton = ""
  140.             parent.head.document.cacheform.chkEnableRatings.checked = true;
  141.             uform = document.userform;
  142.  
  143.             dateObj=parseUIDate(uform.hdnExpiresDateNeutral);
  144.             setExpiresDateCtrl( dateObj );
  145.             
  146.             var yyyy=fullYear(dateObj.getYear());    
  147.             var mo=rpad(2,"0",dateObj.getMonth()+1);
  148.             var dd=rpad(2,"0",dateObj.getDate());
  149.             var hh=rpad(2,"0",dateObj.getHours());
  150.             var mm=rpad(2,"0",dateObj.getMinutes());
  151.             
  152.             var tzdiff= 100*dateObj.getTimezoneOffset()/60;
  153.             var strTzdiff = padGMToffset(tzdiff);
  154.             
  155.             if( tzdiff < 0) //getTimezoneOffset is backwards ie EST is positive
  156.                 parent.head.listFunc.expon =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"+"+strTzdiff;
  157.             else
  158.                 parent.head.listFunc.expon =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+strTzdiff;
  159.  
  160.             
  161.             dateObj=new Date();
  162.             yyyy=fullYear(dateObj.getYear());    
  163.             mo=rpad(2,"0",dateObj.getMonth()+1);
  164.             dd=rpad(2,"0",dateObj.getDate());
  165.             hh=rpad(2,"0",dateObj.getHours());
  166.             mm=rpad(2,"0",dateObj.getMinutes());
  167.  
  168.             if( tzdiff < 0) //getTimezoneOffset is backwards ie EST is positive
  169.                 parent.head.listFunc.seton =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"+"+strTzdiff;
  170.             else
  171.                 parent.head.listFunc.seton =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+strTzdiff;    
  172.                         
  173.             parent.head.listFunc.email = uform.email.value;            
  174.             
  175.         }
  176.         
  177.         function rpad(len,padchr,str)
  178.         {
  179.             str = str.toString();
  180.             if (str.length < len){
  181.                 str = padchr + str;
  182.             }            
  183.             return str;
  184.         }
  185.  
  186.         function fullYear(yearStr)
  187.         {
  188.             if (yearStr < 1000){
  189.                 yearStr += 1900;    
  190.             }
  191.             return parseInt(yearStr);
  192.         }
  193.                             
  194.         function replaceStr(fullStr,oldStr,newStr)
  195.         {
  196.             newFullStr = fullStr;
  197.             if (fullStr.indexOf(oldStr) != 0)
  198.             {
  199.                 newFullStr = fullStr.substring(0,fullStr.indexOf(oldStr));
  200.                 newFullStr += newStr;
  201.                 newFullStr += fullStr.substring(fullStr.indexOf(oldStr)+(oldStr.length),fullStr.length);        
  202.             }
  203.             return newFullStr;
  204.         }
  205.  
  206.         function parseUIDate(dateCntrl)
  207.         {
  208.             newDate = new Date();
  209.             
  210.             if (dateCntrl.value != "")
  211.             {
  212.                 // Use neutral date format
  213.                 datestr = dateCntrl.value;
  214.                 dateParts = datestr.split( "/" );
  215.                 newDate.setYear( parseInt(dateParts[2]) );
  216.                 newDate.setMonth( parseInt(dateParts[0]) - 1 );
  217.                 newDate.setDate( parseInt(dateParts[1]) );
  218.             }
  219.             return newDate;
  220.         }
  221.         
  222.         function parseRatingsDate(dateStr, bExpiresOn)
  223.         {
  224.                                 
  225.         
  226.             dateObj = new Date();
  227.             if( dateStr != "")
  228.             {
  229.                 dateStr = replaceStr(dateStr,"T",".");
  230.                 dateStr = replaceStr(dateStr,"-",".");
  231.                 dateStr = replaceStr(dateStr,":",".");    
  232.     
  233.                 dateArray = dateStr.split(".");
  234.  
  235.                 if (dateArray[0] != "")
  236.                 {
  237.                     dateObj.setYear(dateArray[0]);
  238.                     dateObj.setMonth(dateArray[1]-1);
  239.                     dateObj.setDate(dateArray[2]);            
  240.                 }
  241.             }
  242.             else if( bExpiresOn )
  243.             {
  244.                 // We want expires on to default to a year from now if
  245.                 // it isn't set.
  246.                 var nextYear = parseInt(fullYear(dateObj.getYear())) + 1;
  247.                 dateObj.setYear( nextYear );
  248.             }
  249.             return dateObj;
  250.         }
  251.         
  252.         function setDateCntrl(dateCntrl,dateObj)
  253.         {
  254.             datestr = dateFormatter.getDate( dateObj );
  255.             dateCntrl.value = datestr;
  256.         }        
  257.         
  258.         function setExpiresDateCtrl( dateObj )
  259.         {
  260.             document.userform.hdnExpiresDateNeutral.value = getNeutralDateString( dateObj );
  261.             setDateCntrl( document.userform.hdnExpiresDate, dateObj );
  262.         }
  263.         
  264.         function setCntrl(cntrl,thisval)
  265.         {
  266.             cntrl.value = thisval;
  267.         }
  268.                 
  269.         function popCalendar(cntrlname, blurctrlname, someDate)
  270.         {
  271.             // Called with neutral date string
  272.             if (someDate == "")
  273.             {
  274.                 newdate = new Date();
  275.                 someDate = getNeutralDateString(newdate);
  276.             }
  277.             
  278.             var dateParts = someDate.split( "/" );
  279.  
  280.             width = <%= iHScale(L_CALENDAR_W) %>;
  281.             height = <%= iVScale(L_CALENDAR_H) %>;
  282.             dsize = "width=" + width +",height=" + height;
  283.             thefile="calendar.asp?cntrl="+cntrlname + "&Mo=" + dateParts[0] + "&Dy=" + dateParts[1] + "&Yr=" + dateParts[2] + "&blurcntrl=" + blurctrlname;
  284.             popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no," + dsize);
  285.             if(popbox != null)
  286.             {
  287.                 if (popbox.opener==null)
  288.                 {
  289.                     popbox.opener=self;
  290.                 }
  291.             }
  292.         }            
  293.         
  294.         </SCRIPT>
  295.         
  296.     </HEAD>
  297.     
  298.     <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=10 TEXT="#000000" LINK="#FFFFFF" OnLoad="showLevel();">
  299.  
  300.     <TABLE>
  301.     <TR>
  302.         <TD><%= sFont("","","",True) %>
  303.         <TABLE>
  304.             <TR>
  305.                 <TD>
  306.                     <%= sFont("","","",True) %>
  307.                         <%= L_RATINGS_TEXT %>
  308.                     </FONT>
  309.                 </TD>            
  310.                 <TD>
  311.                     <% if Session("IsIE") then %>
  312.                     <IFRAME NAME="Slider" HEIGHT=<%= L_SLIDERFRM_H %> FRAMEBORDER=0 WIDTH=<%= L_SLIDERFRM_W %> SRC="iislider.asp?stops=5&width=80&prop=hdnPics&selnum=<%= level %>">
  313.                     </IFRAME>
  314.                     <% else %>                
  315.                         <%= writeSlider("hdnPics", 5, L_SLIDERSTEPSIZE_NUM, level) %>
  316.                     <% end if %>
  317.                 </TD>
  318.             </TR>
  319.             </TABLE>
  320.             </FONT>
  321.         </TD>
  322.     </TR>
  323.     </TABLE>
  324.     
  325.     <FORM NAME="userform">
  326.     <TABLE WIDTH = 100%>
  327.     <TR>
  328.         <TD><%= sFont("","","",True) %>
  329.         <%= L_RATING_TEXT %>:  <INPUT READONLY TYPE="text" SIZE = <%= L_RATING_NUM %> NAME="level" VALUE=""  <%= Session("DEFINPUTSTYLE") %>>
  330.         <INPUT TYPE="hidden" NAME="hdnPics" VALUE="<%= level %>">
  331.         <INPUT TYPE="hidden" NAME="HttpPics">    
  332.         </TD>
  333.     </TR>
  334.     </TABLE>
  335.         <P>
  336.  
  337.     <TABLE WIDTH = 100%>
  338.     <TR>
  339.         <TD>
  340.         <%= sFont("","","",True) %>
  341.  
  342.         <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  343.         <%= L_OPTIONAL_TEXT %>
  344.         <IMG SRC="images/hr.gif" WIDTH=<%= L_OPTIONAL_NUM %> HEIGHT=2 BORDER=0 ALIGN="middle">                
  345.         <P>
  346.         
  347.         <%= L_EMAIL_TEXT %>
  348.         <%= inputbox(0,"text","email","",L_EMAIL_NUM,"","","setUpdated();",False,False,False) %>        
  349.         
  350.         </FONT>
  351.         <TABLE>
  352.         <TR>
  353.         <TD>
  354.             <%= sFont("","","",True) %>
  355.                 <%= L_EXPIRES_TEXT %>
  356.             </FONT>
  357.         </TD>
  358.         <TD>
  359.             <%= inputbox(0,"text","hdnExpiresDate","",L_EXPIRES_NUM,"","","setUpdated();",false,false,true)%>
  360.             <INPUT TYPE="hidden" NAME="hdnExpiresDateNeutral" VALUE="" >
  361.              
  362.             <INPUT TYPE="button" VALUE="..." OnClick="popCalendar('document.userform.hdnExpiresDateNeutral', 'document.userform.hdnExpiresDate', document.userform.hdnExpiresDateNeutral.value );">
  363.         </TD>
  364.         </TR>
  365.         <TR>
  366.         <TD>
  367.             <%= sFont("","","",True) %>
  368.                 <%= L_MODIFIED_TEXT %>
  369.             </FONT>
  370.         </TD>
  371.         <TD>
  372.             <%= sFont("","","",True) %>
  373.                 <%= inputbox(0,"text","hdnModifiedDate","",L_MODIFIED_NUM,"","","",false,false,true)%>        
  374.             </FONT>
  375.         </TD>
  376.         </TR>
  377.         </TABLE>
  378.         </TD>
  379.     </TR>
  380.     </TABLE>
  381.     </FORM>
  382.  
  383.     <SCRIPT language="JavaScript">
  384.         setCntrl(document.userform.email,parent.head.listFunc.email);
  385.         setExpiresDateCtrl( parseRatingsDate(parent.head.listFunc.expon, true) );
  386.         setDateCntrl(document.userform.hdnModifiedDate,parseRatingsDate(parent.head.listFunc.seton, false));    
  387.     </SCRIPT>
  388.  
  389. </BODY>
  390. </HTML>
  391.  
  392.